package com.franklin.java.entity.group;

import java.util.List;
import java.util.Objects;

/**
 * @author Franklin
 * @since 2021/08/28 11:48
 */
public abstract class AbstractGroup<T> {

    protected String name;

    protected List<T> elementList;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<T> getElementList() {
        return elementList;
    }

    public void setElementList(List<T> elementList) {
        this.elementList = elementList;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AbstractGroup<?> that = (AbstractGroup<?>) o;
        return Objects.equals(name, that.name) && Objects.equals(elementList, that.elementList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, elementList);
    }
}
